package com.itlong.cloud.property.dao;

import com.itlong.cloud.POJO.PO.PropertyPaymentDataRecordPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      物业缴费数据录入数据访问接口
 * </desc>
 *
 * @createDate 2018/08/17
 */
@Repository
@Mapper
public interface IPropertyPaymentDataRecordDao {
    /**
     * <desc>
     *      保存数据
     * </desc>
     *
     * @param params 数据参数
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/17
     */
    Integer save(Map<String,Object> params);

    /**
     * <desc>
     *      修改数据
     * </desc>
     *
     * @param params 数据参数
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/17
     */
    Integer update(Map<String,Object> params);

    /**
     * <desc>
     *      获取获取相同账单的记录集合
     * </desc>
     *
     * @param feeDataId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/21
     */
    List<PropertyPaymentDataRecordPO> getSmallFeeListByFeeDataId(@Param("feeDataIds") String[] feeDataId,@Param("type") Integer type);

    /**
     * <desc>
     *      获取获取相同账单的记录集合
     * </desc>
     *
     * @param feeDataId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/21
     */
    List<PropertyPaymentDataRecordPO> getFeeListByFeeDataId(@Param("feeDataIds") String[] feeDataId,@Param("type") Integer type);

    /**
     * <desc>
     *      删除录入数据（逻辑删除）
     * </desc>
     *
     * @param feeDataId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/21
     */
    Integer deleteRecordByFeeId(@Param("feeDataId") String[] feeDataId);

    /**
     * <desc>
     *      根据抄表费id获取房间编号
     * </desc>
     *
     * @param feeDataId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/02
     */
    String getRoomIdByDataId(@Param("feeDataId") String feeDataId);

    /**
     * <desc>
     *      获取应缴金额总价
     * </desc>
     *
     * @param roomId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/21
     */
    String getSumDueAmount(@Param("roomId") String roomId,@Param("type") Integer type);

    /**
     * <desc>
     *
     * </desc>
     *
     * @param records
     * @return
     * @author Jiaqi.X
     * @createDate 2018/08/22
     */
    Integer batchAdd(@Param("records") List<PropertyPaymentDataRecordPO> records);

    /**
     * <desc>
     *      查询绑定了规则id的所有未缴费数据
     * </desc>
     *
     * @param feeRuleId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/09/04
     */
    List<PropertyPaymentDataRecordPO> getRecordsByRuleId(@Param("feeRuleId") String feeRuleId);


    /**
     * <desc>
     *      查询账单下的缴费数据
     * </desc>
     *
     * @param feeId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2018/10/12
     */
    List<PropertyPaymentDataRecordPO> getRecordsByFeeId(@Param("feeId") String feeId,@Param("type") Integer type);

    /**
     * <desc>
     *      根据缴费类型查询账单下的记录id
     * </desc>
     *
     * @param feeId
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2019/03/01
     */
    String getRecordIdByFeeIdAndType(@Param("feeId") String feeId,@Param("type") Integer type);

    /**
     * <desc>
     *      查询抄表费下相关联的id
     * </desc>
     *
     * @param feeDataId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/03/19
     */
    String getFeeDataIdsCorrelation(@Param("feeDataId") String feeDataId);
}
